#ifndef __USART_H__
#define __USART_H__

#include "stdio.h"	
#include "stm32f4xx.h"
#include "sys.h" 

#include "typedef.h"

void usart1_init(uint32_t baud);
void usart1_send(const uint8_t *buf, uint32_t len);
int32_t usart1_receive(uint8_t *chr);

void usart2_init(uint32_t baud);
void usart2_send(const uint8_t *buf, uint32_t len);
int32_t usart2_receive(uint8_t *chr);

void usart3_init(uint32_t baud);
void usart3_send(const uint8_t *buf, uint32_t len);
int32_t usart3_receive(uint8_t *chr);
int32_t usart3_receive_wait(uint8_t *chr, int32_t ms);

void usart4_init(uint32_t baud);
void usart4_send_chr(uint8_t val);
void usart4_send(const uint8_t *buf, uint32_t len);
int32_t usart4_receive(uint8_t *chr);

void usart5_init(uint32_t baud);
void usart5_send(const uint8_t *buf, uint32_t len);
int32_t usart5_receive(uint8_t *chr);

void usart6_init(uint32_t baud);
void usart6_send(const uint8_t *buf, uint32_t len);
int32_t usart6_receive(uint8_t *chr);

#endif


